package com.ymttest.database.sqlwapper.CSIM;

import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.YmtFundDimension;
import com.ymttest.database.model.ymt_onlinecs;
import com.ymttest.utils.EnvSetup;

/************************************************************************************
 * @File name : ymt_onlinecsWapper.java
 * @Author : 吴文
 * @Date : 
 * @Copyright : 洋码头
 *csim
 ************************************************************************************/
public class ymt_onlinecsWapper {
	SqlManager manage;

	
	public ymt_onlinecsWapper() {
		manage = new SqlManager("ymtcsim" + EnvSetup.getEnv());
		 
	}
	public List<ymt_onlinecs> selectBy(Map<String,Object> map) throws InterruptedException {
		List<ymt_onlinecs> list = manage.getSelectResults("com.ymttest.database.mapping.ymt_onlinecsMapper.selectBy",map);	     
		manage.commit();
		return list;
	}
	
	
	public int selectBy_Count(Map<String,Object> map) throws InterruptedException {
		List<Map> resultMap = manage.getSelectResults("com.ymttest.database.mapping.ymt_onlinecsMapper.selectBy_Count",map);	
		
		int result=Integer.parseInt(resultMap.get(0).get("count").toString());
		manage.commit();
		return result;
	}
	public int deleteBy(Map<String,Object> map)  {
		int count= manage.delete("com.ymttest.database.mapping.ymt_onlinecsMapper.deleteBy",map);	
		manage.commit();
		return count;
	}
	public int updateByPrimaryKey(ymt_onlinecs record) throws InterruptedException {
		int count= manage.delete("com.ymttest.database.mapping.ymt_onlinecsMapper.updateByPrimaryKey",record);
		manage.commit();
		return count;
	}
	 public ymt_onlinecs selectByPrimaryKey(String id)
	 {
		 ymt_onlinecs model=new ymt_onlinecs();
			List<ymt_onlinecs> list = manage.getSelectResults("com.ymttest.database.mapping.ymt_onlinecsMapper.selectByPrimaryKey",id);	
			if(list.size()>0)
				model=list.get(0);
			manage.commit();
			return model;
	 }
	public static void main(String args[]) {
	  
	}
	
	
}
